*{
    padding: 0;
    margin: 0;
}
div{
    border: 1px solid;
    width: 78px;
    height: 78px;
    float: left;
    background-color: violet;
}
div:nth-child(odd)>div:nth-child(even),div:nth-child(even)>div:nth-child(odd){
    background-color: rgb(151, 71, 255);
}